<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\components\Ueditor;

/* @var $this yii\web\View */
/* @var $model common\models\DhGoods */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="dh-goods-form">

    <?php $form = ActiveForm::begin(['options' => ['enctype'=>"multipart/form-data"]]); ?>

    <?= $form->field($model, 'c_id')->dropDownList(\common\models\DhGoodsCate::getCate(),['prompt'=>'请选择'])->label("分类") ?>
    <?= $form->field($model, 'price')->textInput(['maxlength' => 255]) ?>
    <?= $form->field($model, 'name')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'brand')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'standard')->textInput(['maxlength' => 255]) ?>

    <?= $this->render('/common/_image', ['model' => $model], ['style' => 'width:200px;']); ?>

    <?= $form->field($model, 'desc')->widget(Ueditor::className(),[
        'options'=>[
            'focus'=>true,
        ],
        'attributes'=>[
            'style'=>'height:280px'
        ]
    ]) ?>



    <?= $form->field($model, 'flag')->dropDownList(['1'=>'上架','0'=>'下架'])->label("状态") ?>

    <?= $form->field($model, 'stock')->textInput() ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
